const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('base_qualitysafetysystem', {
    projectid: {
      type: DataTypes.STRING(50),
      allowNull: false,
      comment: "工程ID,主键"
    },
    projectname: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "工程名称"
    },
    address: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "工程地址"
    },
    projectnum: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "工程监督登记号"
    },
    projecttype: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "工程类别(工业建筑\/公共建筑（民用建筑）\/住宅建筑（民用建筑）\/装修装饰 )"
    },
    projectcost: {
      type: DataTypes.DECIMAL(14,6),
      allowNull: true,
      comment: "工程总造价"
    },
    area: {
      type: DataTypes.DECIMAL(14,6),
      allowNull: true,
      comment: "工程总面积"
    },
    floorup: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "工程层数(地上)"
    },
    floordown: {
      type: DataTypes.INTEGER,
      allowNull: true,
      comment: "工程层数(地下)"
    },
    projectstatus: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "工程状态"
    },
    projectxxjd: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "工程形象进度"
    },
    planxkz: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "工程建设规划许可证号"
    },
    province: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "工程所属省"
    },
    city: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "工程所属市"
    },
    structtype: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "结构类型(剪力墙\/框架\/框架剪力墙\/框架核心筒\/砖混\/钢结构\/其他)"
    },
    region: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "所在区县"
    },
    begindate: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "计划开工日期"
    },
    enddate: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "计划完工日期"
    },
    sgxkzh: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "施工许可证号"
    },
    sgtsno: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "施工图审查批准书编号"
    },
    subjectname: {
      type: DataTypes.STRING(500),
      allowNull: true,
      comment: "项目名称"
    },
    subjectid: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "项目主键(项目表主键,关联关系)"
    },
    subjectnum: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "项目监督登记号"
    },
    bjdate: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "报监时间"
    },
    bjman: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "报监人"
    },
    subdistrict: {
      type: DataTypes.STRING(50),
      allowNull: true,
      comment: "街道办事处"
    },
    schedule: {
      type: DataTypes.STRING(100),
      allowNull: true,
      comment: "监督申报时工程进度"
    },
    singleprojnum: {
      type: DataTypes.STRING(100),
      allowNull: true,
      comment: "单体项目编号"
    },
    isDeleted: {
      type: DataTypes.TINYINT,
      allowNull: true,
      comment: "是否删除",
      field: 'is_deleted'
    },
    createdUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "创建人",
      field: 'created_user'
    },
    createdTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "本系统创建时间",
      field: 'created_time'
    },
    updatedUser: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "修改人",
      field: 'updated_user'
    },
    updatedTime: {
      type: DataTypes.DATE,
      allowNull: true,
      comment: "修改时间",
      field: 'updated_time'
    },
    id: {
      autoIncrement: true,
      type: DataTypes.BIGINT,
      allowNull: false,
      primaryKey: true
    }
  }, {
    sequelize,
    tableName: 'base_qualitysafetysystem',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
